<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>作业3</title>
</head>
<body>
<script>
  let n=Math.floor(Math.random()*9+1);
  document.write(n+"<br>");
  let str="";
  function print(n){
      for (let i = 1; i <= n; i++) {
          for (let j = 1; j <= i; j++) {
             str+=j+"*"+i+"="+(i*j)+"&nbsp;&nbsp;&nbsp;";
          }
          str+="<br>";
      }
      document.write(str);
  }
  print(n);
</script>
</body>
</html>